// custom-tab-bar/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected: 0, // 当前选择tabBar中的第一个
    color: "#FFFFFF",
    selectedColor: "#FFFFFF",
    backgroundColor:"#8E9EAB",
    list: [{
      pagePath: "/pages/index/index",
      iconPath: "./icon/home.png",
      selectedIconPath: "./icon/selectedHome.png",
      backgroundColor: "#8E9EAB",
      text: "首页"
    },{
      pagePath: "/pages/store/index",
      iconPath: "./icon/store.png",
      selectedIconPath: "./icon/selectedStore.png",
      backgroundColor: "#0F857C",
      text: ""
    },]
  },
  attached() {
  },
  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        // backgroundColor:data.backgroundColor,
        // selected: data.index
      })
    }
  }
})